<?php
/**
 * Some rights reserved：abc3210.com
 * Contact email:admin@abc3210.com
 */
session_start();
/* load library. */
include_once( '../../comm/config.php' );
require_once('kxClient.php');
/* Build KXOAuth object with client credentials. */
//检查是否登陆
if ($_SESSION["dduserid"] != NULL and $_SESSION["duoduouser"] != NULL) {
    echo "<script language=javascript>window.location='http://".URL."/center.php';</script>";
    exit;
}
else{
    $_SESSION["dduserid"] = NULL;
	$_SESSION["duoduouser"] = NULL;
}
$key[client_id]=KAIXIN_AKEY;
$key[client_secret]=KAIXIN_SKEY;
$key[redirect_uri]=KAIXIN_RequestToken;
$connection = new KXClient($key);
$scope = 'create_records create_album user_photo friends_photo upload_photo';
$aurl =$connection->getAuthorizeURL('code',$scope);
header("Location:".$aurl);
?>